import Vue from "vue";
import Router from "vue-router";

Vue.use(Router);
//导入对应的路由组件
import home from "@/components/Home/home";
import fenlei from "@/components/Fenlei/fenlei";
import yuepin from "@/components/Yuepin/yuepin";
import gouwu from "@/components/Gouwu/gouwu";
import mysleft from "@/components/Mysleft/mysleft";

//导入底部对应的组件
const Guangdong = () =>
  import(/* webpackChunkName: "Guangdong" */ "@/components/Home/Guangdong");
const Hangzhou = () =>
  import(/* webpackChunkName: "Hangzhou" */ "@/components/Home/Hangzhou");
const Shenzhen = () =>
  import(/* webpackChunkName: "Shenzhen" */ "@/components/Home/Shenzhen");
const Accessories = () =>
  import(/* webpackChunkName: "Accessories" */ "@/components/Home/Accessories");
// import Guangdong from "@/components/Home/Guangdong";
// import Hangzhou from "@/components/Home/Hangzhou";
// import Shenzhen from "@/components/Home/Shenzhen";
// import Accessories from "@/components/Home/Accessories";

//导入分类的对应组件
import Pifa from "@/components/Fenlei/pifa";
import Shangzhuang from "@/components/Fenlei/shangzhuang";
import Xiazhuang from "@/components/Fenlei/xiazhuang";
import Peishi from "@/components/Fenlei/peishi";
import Meizhuang from "@/components/Fenlei/meizhuang";

import SearchView from "@/components/publicModule/searchView";
import brand from "@/components/Home/brand";
import category from "@/components/Home/category";
import searchResult from "@/components/Home/searchResult";
import zonghe from "@/components/Home/zonghe";
import xiaoliang from "@/components/Home/xiaoliang";
import jiage from "@/components/Home/jiage";

import Messageview from "@/components/publicModule/messageview";
export default new Router({
  linkActiveClass: "mui-active",
  linkExactActiveClass: "mui-active",
  routes: [
    {
      path: "/",
      component: home,
      redirect: "/home/Guangdong"
    },
    {
      path: "/SearchView",
      component: SearchView,
      name: "SearchView",
      redirect: "/SearchView/brand",
      children: [
        { path: "brand", component: brand, name: "brand" },
        { path: "category", component: category, name: "category" }
      ]
    },
    {
      path: "/searchResult",
      component: searchResult,
      name: "searchResult",
      redirect: "/searchResult/zonghe",
      // redirect:"/SearchView/zonghe",
      children: [
        { path: "zonghe", component: zonghe, name: "zonghe" },
        { path: "xiaoliang", component: xiaoliang, name: "xiaoliang" },
        { path: "jiage", component: jiage, name: "jiage" }
      ]
    },
    {
      path: "/Messageview",
      component: Messageview,
      name: "Messageview"
    },
    {
      path: "/home",
      component: home,
      name: "home",
      redirect: "/home/Guangdong",
      children: [
        {
          path: "Guangdong",
          component: Guangdong,
          name: "Guangdong"
        },
        {
          path: "Hangzhou",
          component: Hangzhou,
          name: "Hangzhou"
        },
        {
          path: "Shenzhen",
          component: Shenzhen,
          name: "Shenzhen"
        },
        {
          path: "Accessories",
          component: Accessories,
          name: "Accessories"
        }
      ]
    },
    {
      path: "/fenlei",
      component: fenlei,
      redirect: "/fenlei/Pifa",
      children: [
        { path: "Pifa", component: Pifa, name: "Pifa" },
        { path: "Shangzhuang", component: Shangzhuang, name: "Shangzhuang" },
        { path: "Xiazhuang", component: Xiazhuang, name: "Xiazhuang" },
        { path: "Peishi", component: Peishi, name: "Peishi" },
        { path: "Meizhuang", component: Meizhuang, name: "Meizhuang" }
      ]
    },
    {
      path: "/yuepin",
      component: yuepin
    },
    {
      path: "/gouwu",
      component: gouwu
    },
    {
      path: "/mysleft",
      component: mysleft
    }
  ]
});
